Skip to content

Conversation

droleary
Copy link

Because the total instance variable only updates in initialize, it does not reflect the correct value when add! is called. This fixes the problem.

A test case is provided to show the bug/fix.

A more robust solution would be to use a total method instead to return the calculated value. It may be worth checking if such a solution is generally faster than doing the calculation every time a Tms object is created/updated. Benchmark the benchmarking! :-)

@hsbt hsbt force-pushed the add_in_place_updates_total branch from d444574 to d97ca7d Compare May 30, 2025 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant